package com.azure.apachedubbo.consumer;

import com.azure.apachedubbo.api.service.DemoUserService;
import org.apache.dubbo.config.annotation.Reference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

/**
 * @Author: liuhuaibin
 * @Date: 2019/2/23 15:50
 * @Description:
 */
@SpringBootApplication
public class StartConsumerApplication {
    private final Logger logger = LoggerFactory.getLogger(getClass());

    @Reference(version = "${demo.service.version}", group = "${demo.service.group}")
    private DemoUserService demoUserService;

    @Bean
    public ApplicationRunner runner() {
        return args -> {
            logger.info("consumer----> "+demoUserService.findAll().toString());
        };
    }

    public static void main(String[] args) {
        SpringApplication.run(StartConsumerApplication.class,args);
    }


}
